//导入request.js 工具
import request from "@/utils/request";
// 文件上传服务
export const uploadFile = (file) => {
  const formData = new FormData();
  formData.append('file', file);

  return request({
    url: '/upload', // 确保路径正确
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data', // 设置Content-Type为multipart/form-data
    },
  });
};